//
//  MineHeadView.m
//  CoachsBook
//
//  Created by huiyong li on 2022/8/17.
//

#import "MineHeadView.h"

@implementation MineHeadView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}


-(void)CreateUI{

    _PleaseLoginBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, 15, APPwidth-30, 75)];
    [_PleaseLoginBtn setBackgroundImage:[UIImage imageNamed:@"blueback"] forState:0];
    _PleaseLoginBtn.layer.shadowOffset = CGSizeMake(1, 1);
    _PleaseLoginBtn.layer.shadowColor = [UIColor grayColor].CGColor;
    _PleaseLoginBtn.layer.shadowOpacity = 0.8;
    [self addSubview:_PleaseLoginBtn];
    
    
    UIImageView *circleimgv = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 40, 40)];
    circleimgv.image = [UIImage imageNamed:@"headicon"];
    circleimgv.layer.cornerRadius = 40/2;
    circleimgv.userInteractionEnabled = YES;
    [_PleaseLoginBtn addSubview:circleimgv];
    
    
    UILabel *PleaseLoginLab = [[UILabel alloc]initWithFrame:CGRectMake(circleimgv.frame.size.width+circleimgv.frame.origin.x+10, 15, 80, 15)];
    PleaseLoginLab.text = @"请登录~";
    PleaseLoginLab.textColor = [UIColor blackColor];
    PleaseLoginLab.textAlignment = 0;
    PleaseLoginLab.font = [UIFont systemFontOfSize:14];
    [_PleaseLoginBtn addSubview:PleaseLoginLab];
    
    UILabel *welcomeDoingLab = [[UILabel alloc]initWithFrame:CGRectMake(circleimgv.frame.size.width+circleimgv.frame.origin.x+10, PleaseLoginLab.frame.size.height+PleaseLoginLab.frame.origin.y+10, 120, 15)];
    welcomeDoingLab.text = @"欢迎您使用教练宝典";
    welcomeDoingLab.textColor = [UIColor grayColor];
    welcomeDoingLab.textAlignment = 0;
    welcomeDoingLab.font = [UIFont systemFontOfSize:12];
    [_PleaseLoginBtn addSubview:welcomeDoingLab];
    
    
    _VipBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, 105, APPwidth-30, (APPwidth-30)/328*89)];
    [_VipBtn setBackgroundImage:[UIImage imageNamed:@"vip_advertising"] forState:0];
    [self addSubview:_VipBtn];
}

@end
